//1.导入axios库
import axios from "axios"
//2.创建axios实例
const instance = axios.create({
    //1.baseURL
    baseURL: "https://apis.map.qq.com/ws/location/v1/",
    //2.超时时间
    timeout: 1000,
})
//3.配置axios(设置拦截器)
//给instance配置响应拦截器
instance.interceptors.response.use(
    function (response) {
        //成功的回调
        return response.data
    },
    function (error) {
        //失败的回调
        return Promise.reject(error)
    }
)
//4.导出插件对象
export default instance
